<template>
  <v-card hover raised>
    <v-list>
      <v-list-item v-for="(item, index) in basicList" v-bind:key="item.id" @click='jumpInto(item.url)'>
        <v-list-tile style="font-size:22px">
          {{ item.value }}
        </v-list-tile>
        <v-divider v-if="index + 1 < basicList.length"></v-divider>
      </v-list-item>
    </v-list>
  </v-card>
</template>

<script>
export default {
  name: 'rightbar',
  props: {
    value: {
      type: String,
      default: ''
    }
  },
  data(){
    return {
      basicList:null
    }
  },
  mounted:function(){
    this.loadBasic()
  },
  methods: {
    jumpInto(url){
      this.$router.push("/articles/"+url)
    },
    loadBasic: function () {
      var vm = this
      var url = '/api/basicKeyList'

      fetch(url, {
        method: 'GET',
        headers: {
          'Content-Type': 'application/json'
        },
        mode: 'cors'
      }).then(function (response) {
        return response.json()
      }).then(function (json) {
        logger.log(json)
        if (json && json.code == 0 && json.data != null) {
          vm.basicList = json.data
        }
      })
    }
  }
}
</script>
